class CreateShims < ActiveRecord::Migration
  def self.up
    create_table :shims do |t|
      t.string :name, :null => false
      
      t.integer :user_id, :null => false, :options => "CONSTRAINT fk_user REFERENCES users(id)" 
      t.string :shim_type, :null => false
      t.string :shim_class
      t.integer :shim_blob_id, :options => "CONSTRAINT fk_shim_blob REFERENCES shim_blobs(id)"
      
      t.integer :service_id, :options => "CONSTRAINT fk_shim_blob REFERENCES services(id)"
            
      t.string :content_type
      t.string :filename
      
      t.timestamps
    end
  end
  
  def self.down
    drop_table :shims
  end
end
